package cn.youqu.happy.module.member.mq.producer.user;

import cn.youqu.happy.framework.mq.core.RedisMQTemplate;
import cn.youqu.happy.module.member.mq.message.user.UserInfoRefreshMessage;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * User 用户相关消息的 Producer
 */
@Component
public class UserProducer {

    @Resource
    private RedisMQTemplate redisMQTemplate;

    /**
     * 发送 {@link UserInfoRefreshMessage} 消息
     */
    public void sendUserInfoRefreshMessage(String nickName, String avatars, Long uid) {
        UserInfoRefreshMessage message = new UserInfoRefreshMessage();
        message.setNickName(nickName).setAvatar(avatars).setUid(uid);
        redisMQTemplate.send(message);
    }

}
